package com.zr.serviceimpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zr.dao.CarUnameDao;
import com.zr.model.Cdriver;
import com.zr.service.CarUnameService;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@Service("caunseim")
public class CarUnameServiceImpl implements CarUnameService{
	@Resource
	private CarUnameDao caundaim;
	@Override
	public JSONArray getUname() {
		JSONArray ja=new JSONArray();
		List<Cdriver>li=caundaim.findDriver();
		for (Cdriver cdriver : li) {
			JSONObject jo=new JSONObject();
			jo.put("id", cdriver.getDid());
			jo.put("text", cdriver.getDname());
			ja.add(jo);
		}
		return ja;
	}

}
